﻿<%@ page language="C#" masterpagefile="MasterPageFrame.master" autoeventwireup="true" inherits="admin_jxspub, App_Web_bgx0xzll" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
    #jxsloginname,#jxspassword,#jxstruename,#jxsphone,#jxsfax,#qq{width:230px}
    #jxscompanyname,#jxsaddress{width:500px}
    #remark{width:500px;height:80px}
    #frame0{width:100%;height:500px}
    </style>
    
    <script type="text/javascript">
        window.onload = function() {
            $("#jxsid").val(location.toString().QueryString("jxsid"));
            $("#urlhref").val(unescape(QueryString("urlhref")));

            if ($("#jxsid").val()) {
                //window.open("xmljxs.aspx?jxsid=" + $("#jxsid").val());
                $form.ElementsDataFromXML("f1", "xmljxs.aspx?jxsid=" + $("#jxsid").val());
                $("#jxspassword").attr("nullabled", "true");
                $("#jxspassword").val("******");
            }
        }
    
        function __formcheck(event) {
            if (!jsformcheck(event))
                return false;
            var sPassword = $("#jxspassword").val();
            if (sPassword.toString().length < 6 || sPassword.toString().length > 50) {
                gE("jxspassword").focus;
                alert("[登录密码]长度错误!密码最少长度为6位，最大长度为50位。");
                return false;
            }
            var v=$("#discountrate").val();
            if (v<=0 || v > 1) {
                alert("折扣率必须大于0并且小于或等于1");
                return false;
            }
            return true;
        }

        function discountrateSetting() {
            document.getElementById("frame0").contentWindow.document.location = "cardtypelistjxs.aspx";

            $('#dialogDiscountrate').dialog({
                autoOpen: false,
                width: 680,
                resizable: false,
                modal: true,
                title: "折扣率设定"
            });

            $('#dialogDiscountrate').dialog('open');
        }

        function __save_discountrate(s) {
            var _d=document.getElementById("frame0").contentWindow.$("#discountrate_" + s).val();
            
            var _t = $("#discountrate").val().split("|");
            var _v;
            var _r="";
            var i;
            var isMatch=false;
            if ($("#discountrate").val() != "") {
                
                for (i = 0; i < _t.length; i++) {
                    _v = _t[i].split(',');
                    if (parseInt(_v[0]) == parseInt(s)) {
                        _v[1] = _d;
                        isMatch = true;
                    }
                    if (_r == "") {
                       
                        _r = _v[0] + "," + _v[1];
                    }
                    else {
                        _r = _r + "|" + _v[0] + "," + _v[1];
                    }
                }
                if (!isMatch) {
                    _r = _r + "|" + s + "," + _d;
                }
               
            }
            else {
                _r = s + "," + _d;
            }
            $("#discountrate").val(_r);
        }
        function __init_discountrate() {
            var _t = $("#discountrate").val().toString().split("|"); 
            var i,__object,_v;
            for (i = 0; i < _t.length; i++) {
                
                _v = _t[i].split(',');
                __object=document.getElementById("frame0").contentWindow.$("#discountrate_" + _v[0]);
                if (__object) {
                    __object.val(_v[1]);
                }
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
    <form name="f1" id="f1" method="post" onsubmit="javascript:return __formcheck(event);">
  	    <table border="0" cellspacing="0" cellpadding="0" class="formtable">
    	    <tr>
	          <td class="WebNote_Field">经销商编号</td>
	          <td><input type="text" name="jxsloginname" id="jxsloginname" nullabled="false" datatype="string" maxlength="50" alerttext="经销商编号"/></td>
	        </tr>
    	    <tr>
	          <td class="WebNote_Field">登录密码</td>
	          <td><input type="text" name="jxspassword" id="jxspassword" nullabled="false" datatype="string" maxlength="50" alerttext="登录密码"/>
	          </td>
	        </tr>
    	    <tr>
	          <td class="WebNote_Field">姓名</td>
	          <td><input type="text" name="jxstruename" id="jxstruename" nullabled="false" datatype="string" maxlength="50" alerttext="登录名"/></td>
	        </tr>
    	    <tr>
	          <td class="WebNote_Field">单位名称</td>
	          <td><input type="text" name="jxscompanyname" id="jxscompanyname" nullabled="false" datatype="string" maxlength="50" alerttext="登录名"/></td>
	        </tr>
    	    <tr>
	          <td class="WebNote_Field">地址</td>
	          <td><input type="text" name="jxsaddress" id="jxsaddress" nullabled="false" datatype="string" maxlength="255" alerttext="地址"/></td>
	        </tr>
    	    <tr>
	          <td class="WebNote_Field">联系电话</td>
	          <td><input type="text" name="jxsphone" id="jxsphone" nullabled="false" datatype="string" maxlength="50" alerttext="联系电话"/></td>
	        </tr>
    	    <tr>
	          <td class="WebNote_Field">传真</td>
	          <td><input type="text" name="jxsfax" id="jxsfax" nullabled="true" datatype="string" maxlength="50" alerttext="传真"/></td>
	        </tr>
    	    <tr>
	          <td class="WebNote_Field">QQ</td>
	          <td><input type="text" name="jxsqq" id="jxsqq" nullabled="true" datatype="string" maxlength="50" alerttext="QQ"/></td>
	        </tr>
    	    <tr>
	          <td class="WebNote_Field"></td>
	          <td>
	          <input type="hidden" name="discountrate" id="discountrate"  alerttext="折扣率"/>
	          <br/>
	            <a href="javascript:discountrateSetting()">折扣率设定</a>
	          <br/><br/>
	          </td>
	        </tr>
    	    <tr>
	          <td class="WebNote_Field">备注</td>
	          <td><textarea name="remark" id="remark" maxlength="255"></textarea></td>
	        </tr>
	        <tr>
	          <td class="WebNote_Field">状态</td>
	          <td>
			    <input type="radio" name="jxsstate" value="1" checked="checked" nullabled="false" alerttext="状态">允许登录
			    <input type="radio" name="jxsstate" value="0">禁止登录
	          </td>
	        </tr>
	        <tr flag="3">
	          <td class="WebNote_Field">系统默认的经销商</td>
	          <td>
			    <input type="radio" name="issystemjxs" value="1" nullabled="false" alerttext="是否系统默认经销商">是
			    <input type="radio" name="issystemjxs" value="0" checked="checked">否
	          </td>
	        </tr>
    	    <tr>
	          <td></td>
	          <td>
			    <input type="hidden" name="jxsid" id="jxsid">
			    <input type="hidden" name="urlhref" id="urlhref">
			    <input type="submit" value="提交" class="btn">
	          </td>
	        </tr>
	    </table>
    </form>
    <div id="dialogDiscountrate" class="X-dialog">
        <span class="divHelp">说明：0.95表示95折的意思（即：原100元的价值的货品以95元购买获得）。填写了折扣率，关闭此对话框后，请按“提交”按钮，以保存生效设置。</span>
        <iframe src="" id="frame0" frameborder="0"></iframe>
    </div>
</asp:Content>

